package com.zbkj.crmeb.task.tools;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.zbkj.crmeb.user.service.UserIntegralSignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;

/**
 * 功能描述: 用户超过7天的签到数据进行删除
 * @Author: wangzh
 * @Date: 2023/3/9 11:05
 */
@Slf4j
@Component
@Configuration
@EnableScheduling
public class DeleteUserIntegralSignRecord {

    @Autowired
    private UserIntegralSignService userIntegralSignService;

    /**
     * 功能描述: 删除用户超过7天的签到记录 每天0：00执行
     * @Param: []
     * @Return: void
     * @Author: wangzh
     * @Date: 2023/3/9 11:08
     */
    @XxlJob("deleteUserIntegralSignRecord")
    public void init() {
        try {
            userIntegralSignService.DeleteUserIntegralSignRecord();
        } catch (Exception e) {
            e.printStackTrace();
            log.error("RemoveUser.task" + " | msg : " + e.getMessage());
        }
    }
}
